//
//  Global.h
//  kasama1
//
//  Created by 丁逸鹏 on 15/3/3.
//
//

#ifndef __kasama1__Global__
#define __kasama1__Global__

#include "cocos2d.h"
#include "editor-support/cocostudio/CCSGUIReader.h"
#include "ui/CocosGUI.h"
#include "SimpleAudioEngine.h"
#include <time.h>
#include <stdlib.h>
#include "Singleton.h"
using namespace cocos2d;
using namespace cocos2d::ui;
using namespace cocostudio;
class Global:public Singleton<Global>
{
public:
    Global(void);
    ~Global(void);
    void createRandNum(int * a,int n,int min,int max);
    void closeDialog(Ref *pSender,TouchEventType type);
    bool writeScore();
    void Swap(int *a,int *b);
    void Sort(int A[],int num);
    void update();
    void init();
    int randnum1;
    int * randpatries;
    int partriesnum;
    int mapid;
    long score;
    int goalindex;
    int volume;
    float hardnum;

    int remainoperate;
    int needpatriesnum;
    int *needpatriesindex;
    int *needpatriesindexnum;
    
    Widget * optionDialog;
    Widget * historyDialog;
    LabelAtlas * score1;
    LabelAtlas * score2;
    LabelAtlas * score3;
    
    bool isPlayMusic;
    char musicpath[30];
    void initMusic();
};

#define global Global::instance()
#endif /* defined(__kasama1__Global__) */
